Snes9x v1.10 29-SEP-1998 ======================== Contents ======== Changes Since Last Release Introduction What's Emulated What's Not What You Will Need Getting Started/Command Line Options Keyboard Controls Joystick Support Netplay Support Super FX Problems With ROMs Sound Problems Converting ROM Images Speeding up the Emulation Credits Changes Since Last Release ========================== 1.10 - Finished NetPlay v1 - allows up to five networked machines to play multi-player SNES games, one player on each machine. - Switchable full-screen mode added to Linux X11 port, some code and ideas nicked from Maciej Babinski's original Snes9x XFree86 DGA Linux port, the UAE Amiga emulator, plus lots of my own code. 1.08 - Bug fixes to C Super FX emulation - now Winter Gold works correctly again. 1.07 - More DSP1 work. Mario Kart is now playable! The character projection code is still broken so the opponents and obstacles aren't always positioned correctly on screen and you keep bumping into them, but I can still keep coming first! - Started work on NetPlay support. - Decreased sound card DMA buffer size on DOS port to improve sound generation and sound CPU synchronisation in some games. - Included Linux joystick driver patches from Vojtech Pavlik so the port can use the new v1.x joystick drivers, again written by Vojtech Pavlik. Allows use of Micro$oft Sidewinder pads, NES and SNES pads, PlayStation pads, Gamepad Pros, etc. - Added halve-the-result colour subtraction. 1.06 - Extended code to allow support for multiple 16-bit screen formats, switchable at run-time, rather just supporting one, selectable at compile time. - Added XFree86 DGA Linux port - code from Maciej Babinski. - More fixes to the X11 image format conversion and setup code. - The asm SetByte routine wasn't wrapping writes to S-RAM correctly, allowing some ROMs to think they were running on a copier and put up an error screen. Thanks to Nu of #rom for the report. - Added 'TV-Mode' support (interpolation and scan-lines) to the DOS and UNIX ports from code based on John Stiles work. - Added v-sync option to the DOS port. - Added fix to Pro Action Reply support, thanks to Paul Shoener III. - Added ggi support (untested) to Linux port using patches from Alexander Larsson (alla@lysator.liu.se). - Added 16 to 24/32 bit image conversion routines to the UNIX X11 code. - The SPC700 OR1 instruction was broken. Thanks to Pyrgopolinices for the report. - DOS port was having trouble splitting and joining path names - caused problems when specifying the full path name of a ROM when the ROM image was on another drive. - If a ROM reset the sound DSP and then turned on echo effects but kept the same echo delay setting, then the echo effects could not be heard. Thanks to madec@mclink.it for the bug report and freeze file that made it easy to find the problem. - DOS port was always using stereo sound setting, if sound card supported it, regardless of the user preference. - Linux port X11 port could crash if window was resized while transparency effects were enabled. - The colour subtraction accelerator look-up table was slightly wrong, causing one bit of red, green blue values to 'spill' into the next field. - Allowed colour window to cut a hole in the main-screen and show the sub- screen underneath. The effect is used by Illusion of Gaia. - Added support for colour subtraction, with the halve-the-result flag set. - Included DSP1 code from _Demo_. Now you can see the track in Mario Kart and the ground in Pilot Wings - still can't play the games though due to other missing commands. - Added an NMI hack to work around a code bug in Battle Toads: BATTLEMANIACS, its only by chance that the game works on a real SNES - And disabled it again because it causes problems for Chrono Trigger. - A frame skip of zero was actually still skipping one frame. Thanks to Marius Fodor for the info. - And yet more X-OR window bug fixes - now the effects during some of the more 'posh' spells look correct in Chrono Trigger. - Yet another window area inversion bug - off by one pixel on right-hand edge. - Forgot to put dummy start and end points for XOR window combination modes - now Uniracers looks correct and Sailor Moon looks like it does on a real SNES. - Window clip code was using wrong index into a 2-dimensional array when the whole of the main or sub-screens were clipped. 1.05 - The master volume disable code was looking that the wrong variable! - Fixed crash bug in newer sound code if a ROM tried to start a sample playing who's data went past the end of SPC700 memory. (Cannon Fodder) 1.04 - Fixed DSP1 ROM header detection bug. - More DSP1 work; still nothing works, although I know the multiply command is correct because I've compared the results against a real DSP1. 1.03 - Oops, the multi-player 5 disable code change broke the multi-player 5 being the default controller. - Implemented the colour window on the main screen - now Zelda's oval zoom window displays correctly and Krusty's Super Fun House clips the left-most 8 pixels as it does on the real SNES. - TERRANIGMA didn't like me returning a random value when it attempted to read a channel's the current sample byte. - Hacked in initial support for mode 7 priority-per-pixel - the priority bit doesn't actually change the priority of the pixel but the two games that I know of that use the feature look OK. (Winter Extreme Skiing and the intro of Tiny Toons Adventures). - Colour addition/subtraction code now uses RGB565 rather than RGB555 calculations - helps a little with the loss of the bottom bit of SNES colour data. - DSP1 emulation started - nothing works yet. 1.02 - Switched to adding back drop colour rather than fixed colour when sub-screen addition is enabled but there's nothing on the sub-screen. Uniracers seems to need it. - DISABLED it again. Causes problems for other ROMs and Uniracers itself on later screens. - Fixed XOR window logic combination mode and area inversion code, now Uniracers works correctly. - Oops, if colour window and half colour addition/subtraction were both switched on, area outside colour window was still being halved, it shouldn't. Hacky fix at the moment until I implement the correct fix. - Fixed several bugs with the mosaic effect and 16x16 tiles and a few possible background scroll offset bugs and the mosaic effect. - Optimised the sound sample generation code for cases when the SNES sample playback frequency was higher than the sound card playback rate. - Fixed possible click sound when a sample was first started to be played. 1.01 - Corrected scanline count for PAL games - should be 312 lines verses 262 for NTSC. Was causing slow music on PAL games. - Added error correction code to the SPC700 timer update code - the SPC700 timers are updated using the emulated h-blank handler which is called every emulated 63.6 microseconds (15.720KHz) but the SPC700 timers need to be updated at multiples of 8KHz, hence the error. Was causing music to be played slightly too fast. - Switched back to using C SPC700 code - the old SPC700 asm code was lacking several optimisations that the C version had. It also had multiple speed hack cycle skipping bugs. Plus I hadn't even finished optimising all the code from the last time I converted the C compiler output. - Optimised SPC700 memory access routines a little. - Disabled code that prevented ROMs updating SPC700 timer values while the timer was running - it seems like it is allowed, even though docs on the 'net I've seen say its not. Introduction ============ Snes9x is a portable, freeware Super Nintendo Entertainment System (SNES) emulator. It basically allows you to play most games designed for the SNES and Super Famicom Nintendo game systems on your PC or Workstation; they include some real gems that were only ever released in Japan. Snes9x is the result of well over a year and a half's worth of part-time hacking, coding, recoding, debugging, divorce, etc. (just kidding about the divorce bit). Snes9x is coded in C++, with three assembler CPU emulation cores on the i386 Linux and Windows ports. Snes9x is better than a real SNES: o Freeze a game at any position, then restore the game to that exact spot at a later date - ideal for saving a game just before a difficult bit. o Built-in cheat cartridge. o Built-in peripheral emulation. The SNES mouse, Multi-player 5 and SuperScope external add-ons are all emulated, they cost extra money with a real SNES. o Stereo sound - yes I know the SNES produced stereo sound, but who actually paid the inflated price for the special lead just so you could hear it? o No more cartridge contact cleaning! o Some SNES hardware features that be turned on and off during game play, games might be using one of these features to deliberately make a section of the game more difficult. Easy, just turn the feature off. o Networked game play. Snes9x is worse than a real SNES: o Unless your computer is very fast (Pentium II+), some games just can't hit every frame being rendered and the emulator starts to omit rendering some frames to keep the emulator running at a constant speed - to you it appears as if the graphics aren't moving as smoothly as they should. o Not all games work; bugs and missing features cause some games to fail to work or renders them un-playable. o You have to wait for your computer to boot before you can play games, no waiting on the real SNES! o The SNES has an analog low-pass sound filter that give a nice bass to all the sounds and music - Snes9x doesn't emulate this. If you have a posh sound card, you could try fiddling with it mixer controls to produce a similar effect. Lower the playback rate can have a similar effect. What's Emulated =============== - The 65c816 main CPU. - The Sony SPC700 sound CPU. - SNES variable length cycles. - 8 channel DMA and H-DMA (raster effects). - All background modes, 0 to 7. - Sound DSP, with eight 16-bit stereo channels, compressed samples, hardware attack-decay-sustain-release volume processing, echo, pitch modulation and digital FIR sound filter. - 8x8, 16x8 and 16x16 tile sizes, flipped in either direction. - 32x32, 32x64, 64x32 and 64x64 screen tile sizes. - H-IRQ, V-IRQ and NMI. - Mode 7 screen rotation, scaling and screen flipping. - Vertical offset-per-tile in modes 2, and 4. - 256x224, 256x239, 512x224, 512x239, 512x448 and 512x478 SNES screen resolutions. - Sub-screen and fixed colour transparency effects. - Mosaic effect. - Single and dual graphic clip windows, with all four logic combination modes. - Colour effects only inside a window. - 128 8x8, 16x16, 32x32 or 64x64 sprites, flipped in either direction. - SNES palette changes during frame (15/16-bit internal rendering only). - Super FX, a 21/10MHz RISC CPU found in the cartridge of several games. - SNES mouse. - SuperScope (light gun) emulated using computer mouse. - Multi-player 5 - allowing up to five people to play games simultaneously on games that support that many players. - Game-Genie, Action Replay and Gold Finger cheat codes. - Multiple ROM image formats, with or without a 512 byte copier header. - Single or split images, compressed using gzip, and interleaved in one of two ways. - Auto S-RAM (battery backed RAM) loading and saving. - Freeze-game support, now portable between different Snes9x ports. What's Not ========== - Only partial DSP1 support, enough to play Mario Kart but no more. The DSP1 is a math co-processor chip that was inside the cartridge of some games, notably Mario Kart and Pilot Wings. - Any other odd chips that manufactures sometimes placed inside the cartridge to enhance games and as a nice side-effect, also act as an anti-piracy measure. - Direct colour mode - uses tile and palette-group data directly as RGB value. - Pseudo hi-res. mode - SNES hardware uses interpolation to give apparent increase in horizontal resolution, use the TV mode to get the same effect. - Mosaic effect on mode 7. - A couple of SPC700 instructions that I can't work out what they should do. - Fixed colour and mosaic effects in SNES hi-res. (512x448) modes. - Offset-per-tile in mode 6. Luckily I haven't found a game that uses it, yet. - Horizontal offset-per-tile in modes 2, 4 and 6. Just noticed that Chrono Trigger uses that. - Cycle counting on SPC700 emulation. - Executing SPC700 instructions during SNES DMA operation. - Exact sound CPU and sound generation synchronisation. - Various pixel priority problems with sprites and transparency effects. What You Will Need ================== CPU --- Faster the better, but 486DX4 100 minimum when using 8-bit graphics and minimal or no sound, Pentium 166 or higher for transparency effects and Pentium 200 or higher for Super FX games. Memory ------ 16Mb or more for Linux. Sun workstations shouldn't have a problem. Screen ------ X Window System ports needs an 8, 15, 16, 24 or 32 bit X server running; transparency effects are available at all depths, but don't look good with only an 8-bit display. For maximum emulation speed, have the X server switched to 8-bit and don't enable transparency effects, or 15 or 16-bit with transparency effects enabled. The Linux SVGA port is very limited at the moment due to no 16-bit screen modes being supported on my two main development machines. However, the Linux X Window System version now has a full-screen mode, so there's hopefully no need to use the SVGA version. Disk Space ---------- 1Mb for the emulator. Software -------- Access to SNES ROM images in *.smc, *.sfc, *.fig or *.1, *.2, or sf32xxxa, sf32xxxb, etc., format otherwise you will have nothing to run! Please note, it is illegal in most countries to have commercial ROM images without also owning the actual SNES ROM cartridge. Getting Started =============== From a shell just type: snes9x to start the X Window System port or ssnes9x to start the Linux SVGA port. ROM images are normally loaded from the directory ./roms. This can be changed by specifying a pathname with the image name or setting the environment variable SNES96_ROM_DIR to point to a different directory. Freeze game files and S-RAM save files are normally read from and written to the directory $HOME/.snes96_snapshots. This can be changed by setting the environment variable SNES96_SNAPSHOT_DIR to point to a different directory. The Linux SVGA port and to get access to full-screen mode on the Linux X Window System port, Snes9x needs root permissions. In the directory where Snes9x is located: su root chown root snes9x ssnes9x chmod 4755 snes9x ssnes9x Some command line flags are available: Graphics options: -tr or transparency (default: off) Enable transparency effects, also enables 16-bit screen mode selection. Transparency effects are automatically enabled if the depth of your X server is 15 or greater. -16 or -sixteen (default: off) Enable 16-bit internal screen rendering, allows palette changes but no transparency effects. -hires or -hi (default: lo-res.) Enable support for SNES hi-res. and interlace modes. USE ONLY IF GAME REQUIRES IT (FEW DO) BECAUSE IT REALLY SLOWS DOWN THE EMULATOR. -y or -interpolate (default: off) Enables 'TV mode', hires support, 16-bit internal rendering and transparency effects. TV mode scales the SNES image by x2 by inserting an extra blended pixel between each SNES pixel and 80% brightness 'scan-lines' between each horizontal line. The result looks very nice but needs a fast machine. Use with the full-screen X mode and a 15 or 16 depth X server, or the SVGA port for fastest operation. -nms or -nomodeswitch (default: switch modes) The Linux X Windows System port can change the screen resolution when switching to full-screen mode so the SNES display fills the whole screen. Specify this option to stop it if causes you problems. -scale or -sc (default: off) Stretch the SNES display to fit the whole of the computer display. Linux X Window System full-screen mode or SVGA port only. Use only if you have a very fast machine. Sound options: -ns or -nosound Disable sound CPU emulation and sound output, useful for the few ROMs where sound emulation causes them to lock up due to timing errors. -sk 0-3 or -soundskip 0-3 (default: 0) ONLY USED IF SOUND IS DISABLED. -stereo or -st (default: stereo) Enable stereo sound output. -mono (default: stereo) Enable mono sound output. Faster, but doesn't sound as nice. -r 0-7 or -soundquality or -sq 0-7 (default: 4) Sound playback rate/quality: 0 - disable sound, 1 - 8192, 2 - 11025, 3 - 16500, 4 - 22050 (default), 5 - 29300, 6 - 36600, 7 - 44000. -b size or -buffersize size or -bs size (default: auto-select) Sound playback buffer size in bytes 128-4096. -envx or -ex (default: off) Enable volume envelope height reading by the sound CPU. Can cure sound repeat problems with some games (e.g. Mortal Kombat series), while causing others to lock if enabled (eg. Bomberman series). -nosamplecaching or -nsc or -nc (default: on) Disable decompressed sound sample caching. Decompressing samples takes time, slowing down the emulator. Normally the decompressed samples are saved just in case they need to be played again, but the way samples are stored and played on the SNES, it can result in a click sound or distortion when caching samples with loops in them. -noecho or -ne (default: on) Turn off sound echo and FIR filter effects. Processing these effects can really slow down a non-MMX Pentium machine due to the number of calculations required to implement these features. -ratio 1+ or -ra 1+ (default: 2) Ratio of 65c816 to SPC700 instructions. Default of 2 is fine for most games, but 3 gets Fifa 96 and games written by the software house Human working. 5 gets The Empire Strikes Back working. There will be others. -nomastervolume or -nmv (default: on) Disable emulation of the sound DSP master volume control. Some ROMs set the volume level very low requiring you to turn up the volume level of your speakers introducing more background noise. Use this option to always have the master volume set on full and to by-pass a bug which prevents the music and sound effects being heard on Turrican. Cheat options: -gg or -gamegenie Supply a Game Genie code for the current ROM. Up to 10 codes can be in affect at once. Game Genie codes for many SNES games are available from: http://game-genie.nvc.cc.ca.us -ar or -actionreplay Supply a Pro-Action Reply code for the current ROM. Up to 10 codes can be in affect at once. At the moment, codes which alter RAM do not work. -gf or -goldfinger Supply a Gold Finger code for the current ROM. Up to 10 codes can be in affect at once. Speed up/slow down options: (See "Speeding Up The Emulation") -f or -frameskip (default: auto-adjust) Set this value to deliberately fix the frame skip rate and disable auto- speed regulation. Use a larger value faster emulation but more jerky movement and a smaller value for smooth but slower screen updates. Use '+' and '-' keys to modify the value during a game. Ideal for some Super FX games that confuse the auto-adjust code or for games that deliberately flash the screen every alternate frame. -frametime